﻿namespace Foundation.Core
{
    /// <summary>
    /// 选项集合标记
    /// </summary>
    [AttributeUsage(AttributeTargets.Method)]
    public class SelectItemsMethodAttribute : Attribute
    {
        public SelectItemsMethodAttribute(string key)
        {
            Key = key;
        }

        /// <summary>
        /// 选项集合标记
        /// </summary>
        /// <param name="key">key</param>
        /// <param name="cacheMinutes">缓存分钟数</param>
        public SelectItemsMethodAttribute(string key, int cacheMinutes)
        {
            Key = key;
            CacheMinutes = cacheMinutes;
        }

        /// <summary>
        /// 选项key
        /// </summary>
        public string Key { get; }

        /// <summary>
        /// 缓存分钟数
        /// </summary>
        public int CacheMinutes { get; set; }
    }
}
